package topcoder.srm147.div2;


public class R950 {

	public class GoldenChain
	{
		public int minCuts(int[] arr)
		{
			java.util.Arrays.sort(arr);
			
			int count=arr.length;
			
			int sum=0;
			
			int res=0;
			
			for(int i=0;i<arr.length;i++)
			{
				if(sum+arr[i]>=count-i-1)
				{
					if(sum+arr[i]>count-i-1)res=count-i;
					else res=count-i-1;
					break;
				}
				sum+=arr[i];
			}
			
			return res;
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
